<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        body,
        html {
            width: 100%;
            height: 100%;
            margin: 0;
            font-family: "微软雅黑";
            font-size: 14px;
        }

        #allmap {
            height: 100%;
            width: 100%;
        }
    </style>
    <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=KyKYGhKT1DYisflH6Lk8OeGxEUYrFKRS"></script>
    <title>预约地址</title>
</head>
<body>
<div id="allmap"></div>
<!--<div id="r-result">-->
<!--    经度: <input id="longitude" type="text" style="width:100px; margin-right:10px;" />-->
<!--    纬度: <input id="latitude" type="text" style="width:100px; margin-right:10px;" />-->
<!--    <input type="button" value="查询" onclick="theLocation()" />-->
<!--</div>-->
</body>
</html>
<script src="../plugins/healthmobile.js"></script>
<script type="text/javascript">

    var coordinate = getUrlParam("coordinate");//根据URL地址栏中的参数名称获取对应的值
    var xy = coordinate.split(",");
    console.log(xy);
    // 百度地图API功能
    var map = new BMap.Map("allmap");
    map.centerAndZoom(new BMap.Point(xy[0],xy[1]),11);
    map.enableScrollWheelZoom(true);
    theLocation();

    // 用经纬度设置地图中心点
    function theLocation(){
        if(xy[0] != "" && xy[1].value != ""){
            map.clearOverlays();
            var new_point = new BMap.Point(xy[0],xy[1]);
            var marker = new BMap.Marker(new_point);  // 创建标注
            map.addOverlay(marker);              // 将标注添加到地图中
            map.panTo(new_point);
        }
    }
    function G(id) {
        return document.getElementById(id);
    }
</script>
